home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Puzzle / PuzzlePuzzle.swf / scripts / DefineButton2_300 / BUTTONCONDACTION on(keyPress Up).as
Encoding:
Text File  |  2005-08-05  |  4.2 KB  |  135 lines

  1. on(keyPress "<Up>"){
  2.    if(0 < manbnumber)
  3.    {
  4.       manb.gotoandplay("down");
  5.       sound.gotoandplay("up");
  6.       bscore = scoreb;
  7.       tjs = 10;
  8.       while(tjs >= 0)
  9.       {
  10.          if(b[manbx][tjs] != 0)
  11.          {
  12.             ttb = tjs + 1;
  13.             atb = tjs + 1;
  14.             break;
  15.          }
  16.          tjs--;
  17.       }
  18.       if(b[manbx][0] == 0)
  19.       {
  20.          ttb = 0;
  21.          atb = 0;
  22.       }
  23.       i = 0;
  24.       while(i < manbnumber)
  25.       {
  26.          if(manbcolor == 1)
  27.          {
  28.             duplicateMovieClip("reds","gb" add (ttb * 8 + manbx),16384 + chengb);
  29.             setProperty("gb" add (ttb * 8 + manbx), _X, manbx * 35 + 362);
  30.             setProperty("gb" add (ttb * 8 + manbx), _Y, ttb * 35 + 55);
  31.             b[manbx][ttb] = 1;
  32.          }
  33.          else if(manbcolor == 2)
  34.          {
  35.             duplicateMovieClip("blues","gb" add (ttb * 8 + manbx),16384 + chengb);
  36.             setProperty("gb" add (ttb * 8 + manbx), _X, manbx * 35 + 362);
  37.             setProperty("gb" add (ttb * 8 + manbx), _Y, ttb * 35 + 55);
  38.             b[manbx][ttb] = 2;
  39.          }
  40.          else if(manbcolor == 3)
  41.          {
  42.             duplicateMovieClip("greens","gb" add (ttb * 8 + manbx),16384 + chengb);
  43.             setProperty("gb" add (ttb * 8 + manbx), _X, manbx * 35 + 362);
  44.             setProperty("gb" add (ttb * 8 + manbx), _Y, ttb * 35 + 55);
  45.             b[manbx][ttb] = 3;
  46.          }
  47.          else if(manbcolor == 4)
  48.          {
  49.             duplicateMovieClip("yellows","gb" add (ttb * 8 + manbx),16384 + chengb);
  50.             setProperty("gb" add (ttb * 8 + manbx), _X, manbx * 35 + 362);
  51.             setProperty("gb" add (ttb * 8 + manbx), _Y, ttb * 35 + 55);
  52.             b[manbx][ttb] = 4;
  53.          }
  54.          ttb += 1;
  55.          chengb += 1;
  56.          if(ttb >= 10)
  57.          {
  58.             break;
  59.          }
  60.          i++;
  61.       }
  62.       bloon2 = manbnumber == 1 && b[manbx][ttb - 2] == manbcolor && b[manbx][ttb - 3] == manbcolor;
  63.       if(manbnumber >= 3 || manbnumber == 2 && b[manbx][ttb - 3] == manbcolor || bloon2)
  64.       {
  65.          iib = 1;
  66.          while(iib < 10)
  67.          {
  68.             if(b[manbx][ttb - iib] != manbcolor)
  69.             {
  70.                break;
  71.             }
  72.             this["gb" add ((ttb - iib) * 8 + manbx)].gotoAndPlay("over");
  73.             scoreb += 10;
  74.             b[manbx][ttb - iib] = 0;
  75.             che = 1;
  76.             while(8 >= che)
  77.             {
  78.                if(b[manbx - che][ttb - iib] != manbcolor)
  79.                {
  80.                   break;
  81.                }
  82.                this["gb" add ((ttb - iib) * 8 + manbx - che)].gotoAndPlay("over");
  83.                scoreb += 10;
  84.                b[manbx - che][ttb - iib] = 0;
  85.                si = 1;
  86.                while(11 >= si && b[manbx - che][ttb - iib + si] != 0)
  87.                {
  88.                   this["gb" add ((ttb - iib + si) * 8 + manbx - che)].gotoAndPlay("down");
  89.                   b[manbx - che][ttb - iib + si] = 0;
  90.                   si++;
  91.                }
  92.                che++;
  93.             }
  94.             che = 1;
  95.             while(8 >= che)
  96.             {
  97.                if(b[manbx + che][ttb - iib] != manbcolor)
  98.                {
  99.                   break;
  100.                }
  101.                this["gb" add ((ttb - iib) * 8 + manbx + che)].gotoAndPlay("over");
  102.                scoreb += 10;
  103.                b[manbx + che][ttb - iib] = 0;
  104.                si = 1;
  105.                while(11 >= si && b[manbx + che][ttb - iib + si] != 0)
  106.                {
  107.                   this["gb" add ((ttb - iib + si) * 8 + manbx + che)].gotoAndPlay("down");
  108.                   b[manbx + che][ttb - iib + si] = 0;
  109.                   si++;
  110.                }
  111.                che++;
  112.             }
  113.             iib++;
  114.          }
  115.       }
  116.       bscore = scoreb - bscore;
  117.       if(160 * xb < scoreb && scoreb < xb * 160 + 160 && x[xb] != 1)
  118.       {
  119.          sss();
  120.          char2.gotoandplay("ded");
  121.          x[xb] = 1;
  122.          xb += 1;
  123.       }
  124.       else if(bscore >= 60)
  125.       {
  126.          sss();
  127.          char2.gotoandplay("happy");
  128.          p2k.gotoandplay(2);
  129.          char1.gotoandplay("cry");
  130.       }
  131.       manbnumber = 0;
  132.       manbcolor = 0;
  133.    }
  134. }
  135.